import request from '@/utils/request'

// 获取权限列表
export function getPermissions(params) {
  return request.get('/permissions', { params })
}

// 获取权限数量
export function getPermissionCount() {
  return request.get('/permissions/count')
}

// 新建权限
export function addPermission(data) {
  return request.post('/permissions', data)
}

// 获取指定权限
export function getPermissionById(id) {
  return request.get(`/permissions/${id}`)
}

// 删除权限
export function delPermissionById(id) {
  return request.delete(`/permissions/${id}`)
}

// 编辑权限
export function editPermission(data) {
  return request.put(`/permissions/${data.id}`, data)
}
